package itcast.web.servlet;

import itcast.domain.Buildmanager;
import itcast.domain.Outt;
import itcast.service.BuildmanagerService;
import itcast.service.OuttService;
import itcast.service.impl.BuildmanagerServiceimpl;
import itcast.service.impl.OuttServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet("/findstudent_outServlet")
public class Findstudent_outServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //1.设置编码
        request.setCharacterEncoding("utf-8");
        //2.获取条件查询参数
        Map<String,String[]> condition=request.getParameterMap();


        //3.调用Service查询
        OuttService service=new OuttServiceImpl();
        List<Outt> outts=service.findstudent_outByDate(condition);

        request.setAttribute("outts",outts);

        //3.跳转到查询所有的Servlet
        request.getRequestDispatcher("/systemadmin/student_out.jsp").forward(request,response);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doPost(request,response);
    }
}
